﻿@model Church.Models.Shared.PuzzlesModel

@{
	Layout = null;
}

<div class="container">
	@if (Model != null && Model.Puzzles != null && Model.CountPuzzles > 0 && Model.Puzzles.Count() >= Model.CountPuzzles)
	{
		if (Model.IsShowBackLink)
		{
			<div class="back-tab">
				<a href="@(Url.Action<HomeController>(m => m.Index()))">Назад</a>
			</div>
		}
		<div class="help">
			<span>@Model.FooterHelp</span>
		</div>
		<ul>
			@for (var item = 0; item < Model.CountPuzzles; item++)
			{
				<li class="thumb">
					<a href="@Model.Puzzles.ElementAt(item).Url">
						<div class="content">
							<h2>@Model.Puzzles.ElementAt(item).Header</h2>
							<p>@Model.Puzzles.ElementAt(item).Description</p>
						</div>
						<div class="wrapper">
							<img src="@Model.Puzzles.ElementAt(item).ImageUrl" />
						</div>
					</a>
				</li>
			}
		</ul>
	}
</div>

<script type="text/javascript">
	$(document).ready(function () {
		church.shared.list.init();
	});
</script>
